package com.xiaomaoguai.cloud.common.utils;

import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * @ ClassName: ResponseEntity.java
 * @ Author: WeiHui-Z
 * @ Date: 2016/12/6 9:27
 * @ Version: v1.0.0
 */
public class ResponseEntity implements Serializable {

	private static final long serialVersionUID = 1997031042288522777L;

	/**
	 * 返回码
	 */
	private Integer code;
	/**
	 * 返回信息
	 */
	private String msg;
	/**
	 * 返回结果集 用户自定义对象
	 */
	private Object data;

	public ResponseEntity() {
	}

	public ResponseEntity(Integer code, String msg, Object data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this)
				.append("code", code)
				.append("msg", msg)
				.append("data", data)
				.toString();
	}
}
